<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/finance/yszk_union/cw_yszk_union_view.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/finance/yszk_union/cw_yszk_union_view.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'id',
                footer: "Foots",
                cnName: '应收账款总表',
                name: 'yszk_union/cw_yszk_union_view',
                url: "/cw_yszk_union_view/",
                sortName: "duedate"
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({"duedate":"","trackname":"","category":"","customer":"","isoverdue":"","iscushion":""});
            const searchFormOptions = ref([[{"title":"应收日期","field":"duedate","type":"month"},{"dataKey":"cw_yszk_trackname_all","data":[],"title":"赛道","field":"trackname","type":"select"},{"dataKey":"cw_yszg_category","data":[],"title":"分类","field":"category","type":"select"}],[{"title":"客户","field":"customer"},{"dataKey":"cw_yszk_isoverdue","data":[],"title":"是否逾期","field":"isoverdue","type":"select"},{"dataKey":"cw_yszk_iscushion","data":[],"title":"是否代垫","field":"iscushion","type":"select"}]]);
            const columns = ref([{field:'id',title:'id',type:'guid',width:110,hidden:true,require:true,align:'left'},
                       {field:'duedate',title:'应收日期',type:'datetime',width:110,align:'left',sort:true},
                       {field:'trackname',title:'赛道',type:'string',bind:{ key:'cw_yszk_trackname_all',data:[]},width:220,align:'left'},
                       {field:'category',title:'分类',type:'string',bind:{ key:'cw_yszg_category',data:[]},width:220,align:'left'},
                       {field:'beginyearnum',title:'年初数',type:'decimal',width:110,align:'left'},
                       {field:'endyearreceivable',title:'年末应收',type:'decimal',width:110,align:'left'},
                       {field:'customer',title:'客户',type:'string',width:220,align:'left'},
                       {field:'monthreceivable',title:'月应收',type:'decimal',width:110,align:'left'},
                       {field:'isoverdue',title:'是否逾期',type:'string',bind:{ key:'cw_yszk_isoverdue',data:[]},width:220,align:'left'},
                       {field:'iscushion',title:'是否代垫',type:'string',bind:{ key:'cw_yszk_iscushion',data:[]},width:220,align:'left'},
                       {field:'cushiontype',title:'代垫类型',type:'string',width:220,align:'left'},
                       {field:'collectionpolicy',title:'收款政策',type:'string',width:220,align:'left'},
                       {field:'accountperiod',title:'账期',type:'string',width:220,align:'left'},
                       {field:'problem',title:'存在的问题',type:'string',width:220,align:'left'},
                       {field:'measure',title:'措施',type:'string',width:220,align:'left'},
                       {field:'receivabledate',title:'应收到期日',type:'datetime',width:150,align:'left',sort:true},
                       {field:'invoicingdate',title:'开票日期',type:'datetime',width:150,align:'left',sort:true},
                       {field:'personliable',title:'责任人',type:'string',width:220,align:'left'},
                       {field:'aging1',title:'1-3个月',type:'decimal',width:110,align:'left'},
                       {field:'aging2',title:'3-6个月',type:'decimal',width:110,align:'left'},
                       {field:'aging3',title:'6-12个月',type:'decimal',width:110,align:'left'},
                       {field:'aging4',title:'1-2年',type:'decimal',width:110,align:'left'},
                       {field:'aging5',title:'2-3年',type:'decimal',width:110,align:'left'},
                       {field:'aging6',title:'3年以上',type:'decimal',width:110,align:'left'},
                       {field:'returnedmoney1',title:'N+1月',type:'decimal',width:110,align:'left'},
                       {field:'returnedmoney2',title:'N+2月',type:'decimal',width:110,align:'left'},
                       {field:'returnedmoney3',title:'N+3月',type:'decimal',width:110,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
